# To change this template, choose Tools | Templates
# and open the template in the editor.

from optparse import OptionParser
from plugin import *

__author__="vbuell"
__date__ ="$Apr 27, 2009 11:16:11 AM$"

KNOWN_SHELLS = ['sh', 'bash', 'python', 'ksh', 'zsh']

if __name__ == "__main__":

    # parse command line options
    parser = OptionParser(conflict_handler="resolve")
    parser.add_option("-u", "--user", dest="login", help="sftp_user1,sftp_user2,...")
    parser.add_option("--check_desktop_links", dest="check_desktop_links", default=False, help="check sftp availability only", action="store_true")
    parser.add_option("-o", "--output_file", dest="output_file", help="write output to FILE")
    parser.add_option("-t", "--log_file", dest="log_file", help="write logs to FILE",
                default="./sFTP_monitor.out")

    (options, args) = parser.parse_args()

    init_plugin_system({'plugin_path': 'cleaners/', 'plugins': ['desktop_links']})
    print find_plugins()

    # Do checking all plugins
    for plugin in get_plugins_by_capability('check'):
        print plugin.do_check()

